﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="blackList.ascx.cs" Inherits="UCWebpart.Admin.blackList" %>

<table style ="width:700px"><tr><td style="width:700px;float:left ">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:CommandField ShowDeleteButton="True" />
        <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="id" Visible="False" />
        <asp:BoundField DataField="blackName" HeaderText="黑名单" SortExpression="blackName" />
        <asp:CheckBoxField DataField="available" HeaderText="available" SortExpression="available" Visible="False" />
    </Columns>
    <EditRowStyle BackColor="#2461BF" />
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#EFF3FB" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#F5F7FB" />
    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
    <SortedDescendingCellStyle BackColor="#E9EBEF" />
    <SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView></td></tr></table>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:meetingroomManagementConnectionString %>" DeleteCommand="UPDATE [blackList] SET [available] = 0 WHERE [id] = @id" InsertCommand="INSERT INTO [blackList] ([blackName], [available]) VALUES (@blackName, @available)" SelectCommand="SELECT * FROM [blackList] where [available] = 1 order by id desc" UpdateCommand="UPDATE [blackList] SET [blackName] = @blackName, [available] = @available WHERE [id] = @id">
    <DeleteParameters>
        <asp:Parameter Name="id" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="blackName" Type="String" />
        <asp:Parameter Name="available" Type="Boolean" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="blackName" Type="String" />
        <asp:Parameter Name="available" Type="Boolean" />
        <asp:Parameter Name="id" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<p>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
&nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="添加" />
</p>
<p>
    <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
    &nbsp;</p>

